from pydantic import BaseModel
from typing import Optional, List


class PositionInfo(BaseModel):
    """岗位信息模型"""
    position_id: str  # 职位ID
    department: str  # 部门
    location: str  # 地区
    position_name: str  # 职位名称
    education_requirement: str  # 学历要求
    major_requirement: str  # 专业要求
    experience_requirement: Optional[str]  # 工作经验要求
    salary_range: Optional[str]  # 薪资范围
    recruitment_number: int  # 招聘人数
    application_deadline: Optional[str]  # 截止日期
    exam_subjects: List[str]  # 考试科目
    job_description: str  # 职位描述
    job_requirements: str  # 职位要求
    extra_benefits: Optional[str]  # 额外福利


class UserInfo(BaseModel):
    """用户信息模型"""
    user_id: Optional[str]  # 用户ID
    education: str  # 学历
    major: str  # 专业
    location_preference: List[str]  # 地域偏好
    salary_expectation: Optional[str]  # 薪资期望
    experience_years: Optional[int]  # 工作经验年数
    professional_certificates: List[str]  # 持有证书
    skills: List[str]  # 技能


class PositionRecommendationRequest(BaseModel):
    """岗位推荐请求"""
    user_info: UserInfo
    top_k: Optional[int] = 5  # 返回前K个推荐岗位


class PositionRecommendationResponse(BaseModel):
    """岗位推荐响应"""
    recommendations: List[PositionInfo]
    recommendation_reasons: List[str]  # 推荐理由
    query_time: str  # 查询时间